<template>
  <div>
    <van-nav-bar
      :title="title"
      left-arrow
      fixed
      @click-left="back"
    />
    <dynamic-form :form-el="formEl" />
    <div class="formSubmitBtn">
      <van-button round block type="info" @click="submitProcess">提交</van-button>
    </div>
  </div>
</template>
<script>
import DynamicForm from '@/components/d-form/DynamicForm'
import { Toast } from 'vant'

export default {
  name: 'Home',
  components: { DynamicForm },
  data() {
    return {
      title: '',
      key: '',
      formEl: [
        {
          groupLabel: '1.基本信息',
          keyId: '41B92C75679221E2',
          editAction: 1,
          list: [
            {
              inputType: 1,
              label: '标志',
              key: 'IsNew',
              value: null,
              text: 'IsNew',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: true,
              colWidth: 20,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 2,
              label: '人员状态',
              key: 'Status',
              value: null,
              text: null,
              colType: 'int',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 4,
              precision: 0,
              dropMode: null,
              dropList: [],
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '编号',
              key: 'A0190',
              value: null,
              text: 'A0190',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: true,
              colWidth: 20,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 3,
              label: '简历锁定者',
              key: 'J03Responsible',
              value: null,
              text: 'J03Responsible',
              colType: 'int',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 60,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: {
                BMTable: 'J01_REPONSE',
                BMField: 'A0188',
                MCField: 'A0101',
                FilterCon: '1=1'
              },
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '标题',
              key: 'J03Title',
              value: null,
              text: 'J03Title',
              colType: 'varchar',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 60,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '简历完整度',
              key: 'FinishScore',
              value: null,
              text: 'FinishScore',
              colType: 'int',
              note: '',
              undermsg: '',
              disabled: false,
              required: false,
              colWidth: 4,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '姓名',
              key: 'A0101',
              value: null,
              text: 'A0101',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: false,
              colWidth: 20,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 2,
              label: '简历分类',
              key: 'BM0000',
              value: null,
              text: null,
              colType: 'int',
              note: '',
              undermsg: '',
              disabled: false,
              required: false,
              colWidth: 4,
              precision: 0,
              dropMode: null,
              dropList: [],
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '身份证号',
              key: 'IDCode',
              value: null,
              text: 'IDCode',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: false,
              colWidth: 20,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 3,
              label: '性别',
              key: 'SEX',
              value: null,
              text: 'SEX',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: false,
              colWidth: 20,
              precision: 0,
              dropMode: 'request',
              dropList: null,
              editFormat: {
                BMTable: 'LOOKUP',
                BMField: 'CONTENT',
                MCField: 'CONTENT',
                FilterCon: "POPU_CODE LIKE 'AX%' AND POPU_CODE!='AX'"
              },
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '户籍',
              key: 'J0306',
              value: null,
              text: 'J0306',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: false,
              colWidth: 50,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '年龄',
              key: 'AGE',
              value: null,
              text: 'AGE',
              colType: 'int',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 4,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '参加工作时间',
              key: 'J0305',
              value: null,
              text: 'J0305',
              colType: 'date',
              note: null,
              undermsg: null,
              disabled: false,
              required: true,
              colWidth: 4,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '现所在地',
              key: 'J0307',
              value: null,
              text: 'J0307',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: true,
              colWidth: 20,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '出生日期',
              key: 'Birthday',
              value: null,
              text: 'Birthday',
              colType: 'date',
              note: null,
              undermsg: null,
              disabled: false,
              required: true,
              colWidth: 4,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '联系电话',
              key: 'TEL',
              value: null,
              text: 'TEL',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: false,
              colWidth: 20,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '出生年月',
              key: 'BirthNY',
              value: null,
              text: 'BirthNY',
              colType: 'varchar',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 100,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: 'Email地址',
              key: 'Email',
              value: null,
              text: 'Email',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: false,
              colWidth: 20,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '地址',
              key: 'ADDR',
              value: null,
              text: 'ADDR',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: true,
              colWidth: 50,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '邮编',
              key: 'PostCode',
              value: null,
              text: 'PostCode',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: true,
              colWidth: 20,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 3,
              label: '简历进入渠道',
              key: 'J0600',
              value: null,
              text: 'J0600',
              colType: 'int',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 4,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: {
                BMTable: 'J06',
                BMField: 'J0600',
                MCField: 'J0601',
                FilterCon: 'ISHIDE=0'
              },
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '资料投递日期',
              key: 'PutDate',
              value: null,
              text: 'PutDate',
              colType: 'date',
              note: null,
              undermsg: null,
              disabled: false,
              required: true,
              colWidth: 4,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            }
          ]
        },
        {
          groupLabel: '2.学历情况',
          keyId: '41B92C75679221E2',
          editAction: 1,
          list: [
            {
              inputType: 1,
              label: '学历',
              key: 'J0301',
              value: null,
              text: 'J0301',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: false,
              colWidth: 50,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '所学专业',
              key: 'J0302',
              value: null,
              text: 'J0302',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: false,
              colWidth: 50,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '毕业院校',
              key: 'J0303',
              value: null,
              text: 'J0303',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: false,
              colWidth: 50,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '毕业时间',
              key: 'J0304',
              value: null,
              text: 'J0304',
              colType: 'date',
              note: null,
              undermsg: null,
              disabled: false,
              required: false,
              colWidth: 4,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 41,
              label: '是否具有海外留学/工作经历',
              key: 'HY',
              value: null,
              text: 'HY',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: true,
              colWidth: 20,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '外语等级',
              key: 'LA',
              value: null,
              text: 'LA',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: true,
              colWidth: 20,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '教育经历',
              key: 'Education',
              value: null,
              text: 'Education',
              colType: 'text',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 4,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            }
          ]
        },
        {
          groupLabel: '3.工作情况',
          keyId: '41B92C75679221E2',
          editAction: 1,
          list: [
            {
              inputType: 1,
              label: '所获得证书',
              key: 'CER',
              value: null,
              text: 'CER',
              colType: 'text',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 4,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '专业技能',
              key: 'Skill',
              value: null,
              text: 'Skill',
              colType: 'text',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 4,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '意向岗位',
              key: 'HopeGW',
              value: null,
              text: 'HopeGW',
              colType: 'varchar',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 100,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '意向工作地',
              key: 'HopeAddr',
              value: null,
              text: 'HopeAddr',
              colType: 'varchar',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 100,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '到岗时间',
              key: 'CanWorkDate',
              value: null,
              text: 'CanWorkDate',
              colType: 'varchar',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 100,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '英文水平',
              key: 'EnglishLevel',
              value: null,
              text: 'EnglishLevel',
              colType: 'varchar',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 100,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '意向职能',
              key: 'HopeCarear',
              value: null,
              text: 'HopeCarear',
              colType: 'varchar',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 100,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '目标行业',
              key: 'HOPEHY',
              value: null,
              text: 'HOPEHY',
              colType: 'varchar',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 100,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '婚姻状况',
              key: 'marryStatus',
              value: null,
              text: 'marryStatus',
              colType: 'varchar',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 100,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '工作性质',
              key: 'WorkPro',
              value: null,
              text: 'WorkPro',
              colType: 'varchar',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 100,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '工作年限',
              key: 'WorkYEAR',
              value: null,
              text: 'WorkYEAR',
              colType: 'varchar',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 100,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '自介绍',
              key: 'SelIntroduction',
              value: null,
              text: 'SelIntroduction',
              colType: 'text',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 4,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '相同工作经历(是/否)',
              key: 'Work',
              value: null,
              text: 'Work',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: true,
              colWidth: 20,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '目前薪资状况',
              key: 'SX',
              value: null,
              text: 'SX',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: true,
              colWidth: 20,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '工作经历',
              key: 'WorkExper',
              value: null,
              text: 'WorkExper',
              colType: 'text',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 4,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            }
          ]
        },
        {
          groupLabel: '4.其它项',
          keyId: '41B92C75679221E2',
          editAction: 1,
          list: [
            {
              inputType: 1,
              label: '备注',
              key: 'Note',
              value: null,
              text: 'Note',
              colType: 'varchar',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 60,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 3,
              label: '简历所属招聘部门',
              key: 'DEPT_ID',
              value: null,
              text: 'DEPT_ID',
              colType: 'int',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 4,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: {
                BMTable: 'J01_ORG',
                BMField: 'DEPT_ID',
                MCField: 'CONTENT',
                FilterCon: '1=1'
              },
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 2,
              label: '简历进入途径',
              key: 'EnterFlag',
              value: null,
              text: null,
              colType: 'int',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 4,
              precision: 0,
              dropMode: null,
              dropList: [
                {
                  value: '0',
                  label: '应聘者输入',
                  label1: null,
                  children: null
                },
                {
                  value: '1',
                  label: '人才网导入',
                  label1: null,
                  children: null
                },
                {
                  value: '2',
                  label: '手工输入',
                  label1: null,
                  children: null
                }
              ],
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '资料过期时间',
              key: 'ExpiredDate',
              value: null,
              text: 'ExpiredDate',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: true,
              colWidth: 20,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '获取招聘信息的来源',
              key: 'LY',
              value: null,
              text: 'LY',
              colType: 'varchar',
              note: null,
              undermsg: null,
              disabled: false,
              required: true,
              colWidth: 20,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '期望薪资',
              key: 'HopeSal',
              value: null,
              text: 'HopeSal',
              colType: 'varchar',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 20,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            },
            {
              inputType: 1,
              label: '目前状况',
              key: 'NowStatu',
              value: null,
              text: 'NowStatu',
              colType: 'varchar',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 100,
              precision: 0,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            }
          ]
        },
        {
          groupLabel: '应聘人才基本信息',
          keyId: '41B92C75679221E2',
          editAction: 1,
          list: [
            {
              inputType: 1,
              label: '期望薪资1',
              key: 'SALARY',
              value: null,
              text: 'SALARY',
              colType: 'number',
              note: '',
              undermsg: '',
              disabled: false,
              required: true,
              colWidth: 19,
              precision: 4,
              dropMode: null,
              dropList: null,
              editFormat: null,
              isLinkField: 0,
              unit: '',
              validate: null
            }
          ]
        }
      ]
    }
  },
  created() {
    debugger
    this.key = this.$route.params.key
    this.title = this.$route.params.title
  },
  methods: {
    showData: function() {
      Toast(this.item.value)
    },
    submitProcess: function() {
      let item
      for (item of this.formEl) {
        let o
        for (o of item.items) {
          console.log(o.key + '=====' + o.value)
        }
      }
    },
    back() {
      this.$router.go(-1)
    }
  }
}

</script>
